package com.suntianci.stock.mapper;

import com.suntianci.stock.pojo.entity.SysPermission;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author 孙天赐
* @description 针对表【sys_permission(权限表（菜单）)】的数据库操作Mapper
* @createDate 2024-12-24 15:39:27
* @Entity com.suntianci.stock.pojo.entity.SysPermission
*/
public interface SysPermissionMapper {

    int deleteByPrimaryKey(Long id);

    int insert(SysPermission record);

    int insertSelective(SysPermission record);

    SysPermission selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SysPermission record);

    int updateByPrimaryKey(SysPermission record);

    /**
     * 查询所有权限集合
     * @return
     */
    List<SysPermission> getAllPermission();

    /**
     * 根据用户id获取用户的权限集合
     * @param userId
     * @return
     */
    List<SysPermission> getAllPermissionByUserId(Long userId);

    /**
     * 根据权限id批量删除信息
     * @param permissionIds
     * @return
     */
    int batchDelete(@Param("permissionIds") List<Long> permissionIds);
}
